//
//  PPFollowModel.m
//  
//
//  Created by GaoYongyue on 16/9/13.
//
//

#import "PPFollowModel.h"

@implementation PPFollowModel

// Insert code here to add functionality to your managed object subclass
+ (instancetype)existingFollowForUserID:(PPUserID)userID {
    PPFollowModel *follow = [self find:@{@"userID" : userID, @"currentUserID" : DGCurrentAccount.userID}];

    if(follow == nil) {
        follow = [PPFollowModel create];
        follow.userID = userID;
        follow.currentUserID = DGCurrentAccount.userID;
        [follow.managedObjectContext saveContext];
    }

    return follow;
}
@end
